<?php
 /******************************************************************************
 *   GunCMS is an avid supporter of open source software. This is the appropriate 
 *   option if you are creating an open source application with a license 
 *   compatible with the GNU GPL license v3.
 *   For details http://www.gnu.org/licenses/gpl.html
 *   DO NOT USE FOR COMMERCIAL WITHOUT PERMISSION
 *
 * GunCMS Version 1.0.3
 * Copyright(c) 2009-2010, T & L GdbR
 * info@guncms.de
 * 
 * http://www.guncms.de
 ********************************************************************************/
/**
 * Class BgcmsProcess
 *
 * @package 	Utils
 * @author		
 * @version
 * @access 		public
 */
class BgcmsAdminmenu {
	
	var $db;
 	var $smarty;	
	public function __construct($db, $smarty) {
		$this->db = $db;
		$this->smarty = $smarty;
	}
		
	public function __destruct() {
		//
	}
	
	public function load_menu_top(){
		$allmenu = BgcmsOverviewBean::get_all_admin_menu($this->db);
		$dem = 0;
		foreach($allmenu as $item) {
			$dem++;
			if(isset($_GET['module']) && $_GET['module']==$item->module_name)
				$item->current_menu = 'active';
			else if(!isset($_GET['module']) && $dem == '1')
				$item->current_menu = 'active';		
					
		}
		$this->smarty->assign("ADMIN_TOP_MENU", $allmenu);
	}
	
}
?>